// 导入模块
const http = require('http');
// 创建服务器
const server = http.createServer();
// 监听请求
server.on('request', (req, res) => {

  // 后填进去的
  res.writeHead(200, {
    "Content-Type": "text/plain;charset=UTF-8"
  });
  if (req.url === '/' || req.url === "/index.html") {
    res.end('首页');
  } else if (req.url === "/about.html") {
    res.end('关于')
  }
})
server.listen(80, () => {
  // 80是默认
  console.log('打开：http://127.0.0.1:80');
})